3.5.46 \(\int \sec ^4(c+d x) (a+b \sec (c+d x)) \, dx\) [446]

Optimal. Leaf size=85 \[ \frac {3 b \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a \tan (c+d x)}{d}+\frac {3 b \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {a \tan ^3(c+d x)}{3 d} \]

[Out]

3/8*b*arctanh(sin(d*x+c))/d+a*tan(d*x+c)/d+3/8*b*sec(d*x+c)*tan(d*x+c)/d+1/4*b*sec(d*x+c)^3*tan(d*x+c)/d+1/3*a
*tan(d*x+c)^3/d

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3872, 3852, 3853, 3855} \begin {gather*} \frac {a \tan ^3(c+d x)}{3 d}+\frac {a \tan (c+d x)}{d}+\frac {3 b \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {b \tan (c+d x) \sec ^3(c+d x)}{4 d}+\frac {3 b \tan (c+d x) \sec (c+d x)}{8 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^4*(a + b*Sec[c + d*x]),x]

[Out]

(3*b*ArcTanh[Sin[c + d*x]])/(8*d) + (a*Tan[c + d*x])/d + (3*b*Sec[c + d*x]*Tan[c + d*x])/(8*d) + (b*Sec[c + d*
x]^3*Tan[c + d*x])/(4*d) + (a*Tan[c + d*x]^3)/(3*d)

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3872

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rubi steps

\begin {align*} \int \sec ^4(c+d x) (a+b \sec (c+d x)) \, dx &=a \int \sec ^4(c+d x) \, dx+b \int \sec ^5(c+d x) \, dx\\ &=\frac {b \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{4} (3 b) \int \sec ^3(c+d x) \, dx-\frac {a \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{d}\\ &=\frac {a \tan (c+d x)}{d}+\frac {3 b \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {a \tan ^3(c+d x)}{3 d}+\frac {1}{8} (3 b) \int \sec (c+d x) \, dx\\ &=\frac {3 b \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a \tan (c+d x)}{d}+\frac {3 b \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {a \tan ^3(c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.27, size = 76, normalized size = 0.89 \begin {gather*} \frac {b \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {3 b \left (\tanh ^{-1}(\sin (c+d x))+\sec (c+d x) \tan (c+d x)\right )}{8 d}+\frac {a \left (\tan (c+d x)+\frac {1}{3} \tan ^3(c+d x)\right )}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^4*(a + b*Sec[c + d*x]),x]

[Out]

(b*Sec[c + d*x]^3*Tan[c + d*x])/(4*d) + (3*b*(ArcTanh[Sin[c + d*x]] + Sec[c + d*x]*Tan[c + d*x]))/(8*d) + (a*(
Tan[c + d*x] + Tan[c + d*x]^3/3))/d

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 73, normalized size = 0.86

method result size
derivativedivides \(\frac {-a \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+b \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(73\)
default \(\frac {-a \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+b \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(73\)
risch \(-\frac {i \left (9 b \,{\mathrm e}^{7 i \left (d x +c \right )}+33 b \,{\mathrm e}^{5 i \left (d x +c \right )}-48 a \,{\mathrm e}^{4 i \left (d x +c \right )}-33 b \,{\mathrm e}^{3 i \left (d x +c \right )}-64 a \,{\mathrm e}^{2 i \left (d x +c \right )}-9 b \,{\mathrm e}^{i \left (d x +c \right )}-16 a \right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}\) \(135\)
norman \(\frac {-\frac {\left (8 a -5 b \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (8 a +5 b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {\left (40 a -9 b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {\left (40 a +9 b \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{4}}-\frac {3 b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {3 b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) \(145\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^4*(a+b*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(-a*(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)+b*(-(-1/4*sec(d*x+c)^3-3/8*sec(d*x+c))*tan(d*x+c)+3/8*ln(sec(d*x+c)
+tan(d*x+c))))

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 95, normalized size = 1.12 \begin {gather*} \frac {16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} a - 3 \, b {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{48 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

1/48*(16*(tan(d*x + c)^3 + 3*tan(d*x + c))*a - 3*b*(2*(3*sin(d*x + c)^3 - 5*sin(d*x + c))/(sin(d*x + c)^4 - 2*
sin(d*x + c)^2 + 1) - 3*log(sin(d*x + c) + 1) + 3*log(sin(d*x + c) - 1)))/d

________________________________________________________________________________________

Fricas [A]
time = 4.09, size = 99, normalized size = 1.16 \begin {gather*} \frac {9 \, b \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 9 \, b \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (16 \, a \cos \left (d x + c\right )^{3} + 9 \, b \cos \left (d x + c\right )^{2} + 8 \, a \cos \left (d x + c\right ) + 6 \, b\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/48*(9*b*cos(d*x + c)^4*log(sin(d*x + c) + 1) - 9*b*cos(d*x + c)^4*log(-sin(d*x + c) + 1) + 2*(16*a*cos(d*x +
 c)^3 + 9*b*cos(d*x + c)^2 + 8*a*cos(d*x + c) + 6*b)*sin(d*x + c))/(d*cos(d*x + c)^4)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right ) \sec ^{4}{\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**4*(a+b*sec(d*x+c)),x)

[Out]

Integral((a + b*sec(c + d*x))*sec(c + d*x)**4, x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 164 vs. \(2 (77) = 154\).
time = 0.48, size = 164, normalized size = 1.93 \begin {gather*} \frac {9 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 9 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (24 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 15 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 40 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 9 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 40 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 15 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

1/24*(9*b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 9*b*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(24*a*tan(1/2*d*x +
1/2*c)^7 - 15*b*tan(1/2*d*x + 1/2*c)^7 - 40*a*tan(1/2*d*x + 1/2*c)^5 - 9*b*tan(1/2*d*x + 1/2*c)^5 + 40*a*tan(1
/2*d*x + 1/2*c)^3 - 9*b*tan(1/2*d*x + 1/2*c)^3 - 24*a*tan(1/2*d*x + 1/2*c) - 15*b*tan(1/2*d*x + 1/2*c))/(tan(1
/2*d*x + 1/2*c)^2 - 1)^4)/d

________________________________________________________________________________________

Mupad [B]
time = 3.57, size = 152, normalized size = 1.79 \begin {gather*} \frac {\left (\frac {5\,b}{4}-2\,a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {10\,a}{3}+\frac {3\,b}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {3\,b}{4}-\frac {10\,a}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,a+\frac {5\,b}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {3\,b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{4\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b/cos(c + d*x))/cos(c + d*x)^4,x)

[Out]

(tan(c/2 + (d*x)/2)*(2*a + (5*b)/4) - tan(c/2 + (d*x)/2)^7*(2*a - (5*b)/4) - tan(c/2 + (d*x)/2)^3*((10*a)/3 -
(3*b)/4) + tan(c/2 + (d*x)/2)^5*((10*a)/3 + (3*b)/4))/(d*(6*tan(c/2 + (d*x)/2)^4 - 4*tan(c/2 + (d*x)/2)^2 - 4*
tan(c/2 + (d*x)/2)^6 + tan(c/2 + (d*x)/2)^8 + 1)) + (3*b*atanh(tan(c/2 + (d*x)/2)))/(4*d)

________________________________________________________________________________________